package com.kwok.hotel.es.db.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kwok.hotel.es.db.dao.HotelDao;
import com.kwok.hotel.es.db.entity.Hotel;
import com.kwok.hotel.es.db.service.EsSearchService;
import com.kwok.hotel.es.db.service.HotelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 酒店表(Hotel)表服务实现类
 *
 * @author makejava
 * @since 2024-06-22 17:07:14
 */
@Service("hotelService")
public class HotelServiceImpl extends ServiceImpl<HotelDao, Hotel> implements HotelService {

    @Autowired
    private EsSearchService esSearchService;

    @Override
    public boolean save(Hotel entity) {
        //保存到数据库
        super.save(entity);
        //保存到ES索引库
        esSearchService.saveHotel(entity);
        return true;
    }
}

